import feedparser
import pprint
#import MySQLdb
from sqlobject import *

#db=MySQLdb.connect(user="anigrid",passwd="anigrid",db="anigrid")
#dbc=db.cursor()
#dbc.execute("SELECT data from rss_feeds")
#for result in dbc.fetchall():
#	print result
#	feed = feedparser.parse(result)


#FEED = {}
#FEED = eval(result[0])



#print FEED['feed']['title']
#print FEED.feed.title

dbc = connectionForURI('mysql://anigrid:anigrid@localhost/anigrid')
sqlhub.processConnection = dbc

class rss_feeds(SQLObject):
    name=StringCol()
    url=StringCol()
    data=StringCol()


#rss_feeds.createTable()
p = rss_feeds.select()

for ele in list(p):
    data = {}
    data = eval(ele.data)
    print data['feed']['title']
    print data.feed.title
#    print data
#    feed = feedparser.parse(data)
#    print feed

    
